- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 05:45 AM
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.
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 06:06 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 06:00 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 06:06 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2018 01:41 AM
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
})
(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2018 01:53 AM