# Ayanda Makhathini

## Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
• Author
Posts
• in reply to: Multiple Rule conditions #23559

Ayanda Makhathini
Participant

Hi Alex

This example looks like it can definitely workout. I managed to get it to work using the quantity field onchange rule to call both functions and there are if statements in both functions to calculate when it equal to a certain category. I’m getting a different error now but it’s hard to explain still going to investigate whats the issue before thinking about opening another thread. Thank you

Regards
Mak

• #23112

Ayanda Makhathini
Participant

Hi Alex

I used var price = parseFloat(getFieldValue(“Price”)).toFixed(2); to convert to number then i did calculations then converted to string with comma, You helped me alot. Thank you very much

Regards
Mak

• #22991

Ayanda Makhathini
Participant

Hi Alex

Thank you for the function it works.The calculation,rounding off and replace comma works well but i noticed that I’m losing couple cents if I dont round off the value of the item which isn’t rounded off when i get it from look up list, I’m using the function below to get the value(hprice) and try using the toFixed(2) but i get a error. Not sure yet but also working on it.

function convertprice()
{
var hPrice = getFieldValue(“h_price”);

var priceValueFixed = hPrice.toFixed(2);

setFieldValue(“h_price”,priceValueFixed);

}

Regards

###### Attachments:
• #22968

Ayanda Makhathini
Participant

Hi Alex

I also noticed that my calculations are not rounding off to 2 decimal places. I have the value 6118.43 pulling in as 6118.425 on the form. When I calculate (value) x (quantity) = (6118.425 x 2 = 12236850) . After that I calculate VAT and Total excluding VAT (VAT=15%). Amount including VAT is 14072.37 but i get 14072377.5 which will save as 14 Million if i replace comma. Would adding a custom function to round off solve the issue or is there a shorter way around it. I managed to remove decimals and replace them with commas but this wont if I’m rounding off to wrong decimal place. I currently have my calculations set in the DFFS rules. Amount exluding VAT = calc:{h_price}*{Quantity} , Total including VAT – calc:{Amount}*0.15+{Amount} . I think my main issue is to round off now

regards

###### Attachments:
• #22965

Ayanda Makhathini
Participant

hi Alex

I’m using the the CCDD to select the product from another list which selects the price in the lookup list which is a currency field. I’m using a DFFS rule in the current list to set the h_price field which is a currency field. I’m trying to use a Custom JS function to change decimals to comma’s when the field changes but my syntax is not that great

• in reply to: Pull user info from a people picker #22602

Ayanda Makhathini
Participant

Hi Alex

I found the issue it was my JS syntax. my query is trying to set (userprofile) that hasnt been set hence undefined.

function populateSPNameAndEmail()
{
console.log(ppData);
setFieldValue(“Full_x0020_Name”,ppData.Title);
});
}

I had the wrong field aswell in the above code for SipAdress.
Thank you for the jQuery its very useful

• in reply to: Pull user info from a people picker #22598

Ayanda Makhathini
Participant

Hi Alex

my code is showing undefined. Even when i test the spjs.utility.userInfo(login); section which i think is to get the user details in the people picker its returning undefined

I also have triggered the function on save in the rules.

fieldInternalName = SP_x0020_Email_x0020_Valid

Thanks

###### Attachments:
• in reply to: Pull user info from a people picker #22586

Ayanda Makhathini
Participant

Hi Alex

My code is similar(if not the same) as Notrega , but unfortunately he did not post what he did to solve his problem , I cant seem to find the difference between your JS above and his/hers .

I’m trying to populate the users title and SipAddress in the respective fields but when I save on edit and New form i doesnt seem to get the information of the user. I have the rule to trigger the function on save but it still get nothing.

Can you help me?

(I did remove _ID from DispForm but it still didnt work)

###### Attachments:
Viewing 8 posts - 1 through 8 (of 8 total)