0

Multiplying two fields and adding the result to the third field

Aug 02, 2017 at 12:29 PM

123

Former Member

Dear Experts,

I have the requirement where I want the result as A=(B*Constant field)+C. These three fields are amount field. Request you to please help. I want to add all these fields and do the operations in opportunity header part.

Regards,

Pragati

Patric Leßmann Aug 02, 2017 at 03:41 PM
1

Hi Pragati,

what is your exact problem or question?

In general you can achieve this using the KeyUserTools (no need of Cloud Application Studio) by

3. checking "calculated"
4. defining your formula to calculate the value.

Best regards,

Patric

Show 3 Share
Former Member

Hi Patrick,

This is the scenario.

There are three fields

1) A=100 INR(Indian National Rupee Currency)

2) B=12 months

3) C= 100 INR

Now we have the requirement to do this operation

(A*B)+C=D( D is another custom field)

I have tried it with the KUT but when try to do the operation (A*B)=X(Storing the result in field X)

I am not able to do X+C=D as the field "C" is not available while trying to do this operation.

Regards,

Pragati verma

Former Member

Its done.

import ABSL; //import AP.FO.BusinessPartner.Global; import AP.Common.GDT; import AP.FO.BusinessPartnerRelationship.Global; import AP.CRM.Global; import AP.FO.Activity.Global; foreach (var customer in this) { var Constant=this.GetFirst().Month; var MR= this.GetFirst().MRC.content; var NR= this.GetFirst().NRC.content; var Multiply=MR*Constant; var F=Multiply+(NR); this.GetFirst().Fi=F.ToString().TrimRight("0"); }

but it just shows the result as 130.0000 I tried trimming so it shows now 130.

I want to just display 130.00 only two zeros after decimal.

Regards,

Pragati Verma

Hi Pragati,

If you want to have two decimal, you should define your custom fields in a way that can show just two decimal.