Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


calculate field to populate from part of another field

Community Beginner ,
May 27, 2021 May 27, 2021

Copy link to clipboard

Copied

I am new to Adobe so I am not the best with figuring things out. I work at a financial instiution and we are looking to have a field that is for an account number, and then an additional field for the suffix. Our Core system has a mapping code that pulls in both the account number and the suffix number into one field. However, I need these to be separted.

 

This is how the mapping pulls in the information - all account numbers are 10 digits long

defaultrfjue3aoi30b_0-1622123438320.png

 

This is the actaul mapping code, and the fields that I want to be filled. The account number needs to be the 10 digits, and the share ID really just needs to be the 4 digits after the S.

defaultrfjue3aoi30b_1-1622123526601.png

 

TOPICS
Create PDFs, Edit and convert PDFs, General troubleshooting, How to, JavaScript, PDF forms

Views

196

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , May 27, 2021 May 27, 2021
You can use this as calculation script of the "LOAN_1_LN_TRANSFER_1_SHARE_SERIAL_DESCRIPTION" field: var acc = this.getField("From account number"); var id = this.getField("share ID"); var str = event.value; var v = str.slice(0,10); var i = str.slice(11,15); if(event.value == ""){ acc.value = ""; id.value = "";} else{ acc.value = v; id.value = i;}

Likes

Translate

Translate
Adobe Community Professional ,
May 27, 2021 May 27, 2021

Copy link to clipboard

Copied

You can use this as calculation script of the "LOAN_1_LN_TRANSFER_1_SHARE_SERIAL_DESCRIPTION" field:

var acc = this.getField("From account number");
var id = this.getField("share ID");
var str = event.value;
var v = str.slice(0,10);
var i = str.slice(11,15);
if(event.value == ""){
acc.value = "";
id.value = "";}
else{
acc.value = v;
id.value = i;}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 27, 2021 May 27, 2021

Copy link to clipboard

Copied

LATEST

Thank you! I just modified the numbers a little bit but it worked!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines