I want to populate Delivery address from the REQ to RITM but it is not populating

Raju Singh1
Tera Expert

I am working on Order guide. When I order something . It asks me for an Shipment address and this gets populated in the REQ as Delivery Address (this is an oob field)

I want to populate this Delivery address from my REQ to RITM Shipment address.

Please find the attached screen shots.

Capture.JPG

Capture1.JPG

Capture2.JPG

before_business Rule.JPG

Capture3.JPG

I have written a business Rule (before) script but it is now working. However Shipment address field in RITM is not a variable.

This is the business Rule

(function executeRule(current, previous /*null when async*/) {

// Add your code here

current.u_shipmentaddress=current.request.delivery_address;   // Delivery address field on RITM form has field name u_shipmentaddress

})(current, previous);

Please help me..

Regards,

Raju Singh

1 ACCEPTED SOLUTION

Rajesh Annepak1
Kilo Guru

Hi Raju ,



It seems the business rule that you have written is fine and also please include current.update() and check once again



Type : Before Business rule



Condition : Requested_item.Item = Catalog Item Name


Add Script : current.update



Please let me know if this doesnt work for you



If your query is resolved / helpful please hit correct/ helpful



Rajesh Kumar Annepaka


View solution in original post

6 REPLIES 6

Vishal Khandve
Kilo Sage

Hi Raju,



Use after Insert, update BR


var inc = new GlideRecord('Req');


inc.addQuery('sys_id',current.shippingAdd);


inc.query();


if(inc.next())


{





inc.shippingAdd   = current.deliveryAdd;


inc.update();


}



Thank you,


Vishu


Rajesh Annepak1
Kilo Guru

Hi Raju ,



It seems the business rule that you have written is fine and also please include current.update() and check once again



Type : Before Business rule



Condition : Requested_item.Item = Catalog Item Name


Add Script : current.update



Please let me know if this doesnt work for you



If your query is resolved / helpful please hit correct/ helpful



Rajesh Kumar Annepaka


Hi Rajesh,



Could you please let me know what exactly is the complete script which you recommended.



Where in my current script shall I add current.update



This is my script



(function executeRule(current, previous /*null when async*/) {




// Add your code here


current.u_shipmentaddress=current.request.delivery_address;   // Delivery address field on RITM form has field name u_shipmentaddress


Capture4.JPG


})


(current, previous);


Hi All,



My query was already correct.


I did a blunder. I didnt check the insert and update check mark for my business Rule. That was the reason it was not working.


I have highlighted this in yellow color in the screen shot what I missed to check . Capture5.JPG